app.config(function($stateProvider, $urlRouterProvider) {
  $stateProvider
  /* 岗位类型清单 */
  .state('nature', {
    url: '/nature',
    templateUrl: 'app/partials/position/nature/index.html',
    controller: function($scope,Nature) {
      $scope.widget_title = '岗位类型管理';
      $scope.natures = Nature.query();
      /* 删除 记录*/
      $scope.itemDelete = function(item){
        Nature.delete({},{"id": $scope.natures[item].name})
        $scope.natures.splice(item, 1); 
      }

   }
  })
 
 /*添加岗位类型*/
 .state('nature.new', {
    url: '/new',
    templateUrl: 'app/partials/position/nature/form.html',
    controller: function($scope,$state,Nature) {
      $scope.widget_title = '添加岗位类型';
      $scope.update = function(nature){
        Nature.save(nature,function(nr){
          $scope.natures.push(nr);
        });
        
        $scope.nature = {};
        $state.go('nature');
      }
   }
  })
})